package net.huashitong.oversee.dao;

import com.sirdc.modules.core.dao.GenericQuery;
import com.sirdc.modules.core.dao.StringDao;
import net.huashitong.oversee.entity.TaskMethon;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class TaskMethonDao extends StringDao<TaskMethon> {

    /**
     * 所有督查手段
     * @return
     */
    public List<TaskMethon> getAllMethon()
    {
        GenericQuery query = createQuery("t");
        return query.listResult();
    }

    public TaskMethon getMethon(String methon)
    {
        GenericQuery query =createQuery("t");

        query.append("and t.methonCode=:methonCode").setParam("methonCode",methon);

        return query.singleResult();


    }

}
